import java.util.Scanner;
public class Lab03Task06 {
	public static void main(String[] args) {
		double p,n;
		int f;
		Scanner kb=new Scanner(System.in);
		System.out.println("Enter the probabiity [0,1) :");
		p=kb.nextDouble();
		n=(1+Math.sqrt(1+8*(Math.log10(1-p)/Math.log10(364.0/365.0))))/2;
		f=(int)n;
		System.out.printf("The probabiity that 2 people in a group of %d have the same birthday is %f",f,p);
	}
}